import React from 'react'
import styles from './index.less'
import icon from '../../assets/my/rightArrow.png'
import { useDispatch, useHistory } from 'dva'
import { useIntl } from 'umi';
function Index() {
  const intl = useIntl();
  const history = useHistory()
  const lists = [
    {
      title:intl.formatMessage({id:'EXHIBITION'}),
      callback: () => {
        history.push('/exhibitionInfo/infoPage')
      }
    },
    {
      title:intl.formatMessage({id:'EXHIBITORS'}),
      callback: () => {
        history.push('/exhibitionInfo/exhibitionList')
      }
    },
    {
      title:intl.formatMessage({id:'BOOTH'}),
      callback: () => {
        history.push('/exhibitionInfo/boothLayout')
      }
    },
    {
      title:intl.formatMessage({id:'SERVICE'}),
      callback: () => {
        history.push('/exhibitionInfo/serviceGuide')
      }
    },
    {
      title:intl.formatMessage({id:'CONFERENCE'}),
      callback: () => {
        history.push('/exhibitionInfo/meetingList')
      }
    },
    {
      title:intl.formatMessage({id:'PREVIEW_ACTIVITIES'}),
      callback: () => {
        history.push('/exhibitionInfo/activityList')
      }
    }
  ]
  return (
    <div className={styles.page}>

      <div className={styles.listBox}>
        {
          lists.map((item, index) => {
            return <div className={`${styles.item} ${index != (lists.length - 1) && styles.lastItem}`}
              key={index}
              onClick={() => {
                item.callback && item.callback()
              }}
            >
              <span className={styles.title}>{item.title}</span>
              <img src={icon} className={styles.icon}></img>
            </div>
          })
        }
      </div>
    </div>
  )
}

export default Index
